package seiacpjava_a2.datastructures.tree;

public class SearchResult {

	
	private final int nbrAccess;
	private final boolean isFound;
	
	public SearchResult(int nbrAccess, boolean isFound) {
		this.nbrAccess = nbrAccess;
		this.isFound = isFound;
	}

	public int getNbrAccess() {
		return nbrAccess;
	}

	public boolean isFound() {
		return isFound;
	}

	@Override
	public String toString() {
		return "SearchResult [nbrAccess=" + nbrAccess + ", isFound=" + isFound
				+ "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (isFound ? 1231 : 1237);
		result = prime * result + nbrAccess;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SearchResult other = (SearchResult) obj;
		if (isFound != other.isFound)
			return false;
		if (nbrAccess != other.nbrAccess)
			return false;
		return true;
	}
}

